package 第二章_JavaSE基础.二_JavaSE语法;

import 第二章_JavaSE基础.一_Java面向对象.如何理解clone对象.A;

public class 等于和equals {
    public static void main(String[] args) {
        int i = 5,j = 5, z = 5;
        //==
        System.out.println(i == j);//判断值是否相等
        try {
            //System.out.println(i.equals(z));//equals不能比较基本类型（String）不是基本类型

        } catch (Exception e){
            e.printStackTrace();
        }
        System.out.println("--------------------");
        A a = new  A();
        A a2 = new A();
        A a3 = a;
        System.out.println(a == a2);
        System.out.println(a == a3);
        System.out.println(a.equals(a2));
        System.out.println(a.equals(a3));
    }

    public void A(){

    }
}
